﻿using System;
using System.IO;
using System.Text;

namespace C__IO
{
    class Program
    {
        static void Main(string[] args)
        {
            string content = ""; 
            string line = "";   
            while (true)
            {
                line = Console.ReadLine();
                if(line.Length == 0) break;
                content += line + "\n";
            }
            
            byte[] info = new UTF8Encoding(true).GetBytes(content);
            FileStream fs = new FileStream("out.txt",FileMode.OpenOrCreate,FileAccess.ReadWrite);
            fs.Write(info);
            fs.Flush();
            fs.Close();
        }
    }
}
